home *** CD-ROM | disk | FTP | other *** search
/ Precision Software Appli…tions Silver Collection 4 / Precision Software Applications Silver Collection Volume 4 (1993).iso / stats / chadyn.exe / YCOMUNDC.C < prev    next >
Text File  |  1988-12-09  |  6KB  |  251 lines

  1. /******************* (C) 1986,7,8 by JAMES A. YORKE **************************/
  2. /**********************    Routines in YCOMNDSU.C  **************************
  3. some routines in file:
  4. int UndocumentedCommands()
  5. int caseColor() -- moved to YSCREEN.C
  6. ColorMenu() -- moved to YSCREEN.C
  7. invert() -- moved to YCOMDE.C
  8. ***************************************************************************/
  9.  
  10. #include "yinclud.h"
  11. /*#define DEBUG*/
  12. static  FILE * temp;
  13.  
  14.  
  15. int     UndocumentedCommands(CodeName)
  16. char    *CodeName;
  17. {
  18.     int     i,
  19.             oldCycle;
  20. #ifdef DEBUG
  21.     fprintf(stderr, "UndocumentedCommands(%s)\n", CodeName);
  22.     pause(1.5);
  23. #endif
  24. #ifndef MAINFRAME
  25.     TEST("q")
  26.     {
  27.         setRGBColor();/* will be asked for color plus 3 integers */ 
  28.         return(1);
  29.     }
  30. #endif /* ifndef MAINFRAME */
  31.     TEST("w")
  32.     {
  33.         whenAndWhere();/* for interrupt W and command W */
  34.         return(1);
  35.     }
  36.     TEST("sss") {
  37.         if(SCREEN) {
  38.             PRINT
  39.                 "Enter an integer < 5 and 4 floating point numbers on one line.\n");
  40.  
  41.             PRINT
  42.                 "They must be separated by spaces, no commas then  hit <return>.\n");
  43.  
  44.             PRINT
  45.                 "Specifically: \n");
  46.  
  47.             PRINT
  48.                 "ScrnSec(>=0 and <=4)  X_lower  X_upper  Y_lower  Y_upper \n");
  49.         }
  50.  
  51.         fscanf(input, " %d %lf %lf %lf %lf \n",
  52.                 &ScrnSec, &X_lower, &X_upper, &Y_lower, &Y_upper);
  53.         if(SCREEN)
  54.             PRINT "ScrnSec=%d x=%lf X=%lf y=%lf Y=%lf\n",
  55.                 ScrnSec, X_lower, X_upper, Y_lower, Y_upper);
  56.         ScreenConstants();
  57.         ScrnSec = 0;
  58.         return(1);
  59.     }
  60.     TEST("j") {
  61.         jay();
  62.         return(1);
  63.     }
  64.     TEST2("colp", "colorplanes") {
  65.         PRINT
  66.             "You have %d colorPlanes \n", colorPlanes);
  67.         colorPlanes = (int) Entervalue((double) colorPlanes, CHECKSET);
  68.         return(1);
  69.     }
  70.     TEST2("int", "intrpt") {
  71.         oldCycle = cycle;
  72.         cycle = 1;
  73.         Interrupt();
  74.         cycle = oldCycle;
  75.         return(1);
  76.     }
  77.     TEST("test") {
  78.         testFlag = 1 - testFlag;
  79.         PRINT "testFlag now = \n");
  80.         toggle(testFlag);
  81.         return(1);
  82.     }
  83.  /* The following 6 are for YU.C */
  84.     TEST("frac") {
  85.         frac = Entervalue(frac, CHECKSET);
  86.         return(1);
  87.     }
  88.     TEST("length") {
  89.         length = Entervalue(length, CHECKSET);
  90.         return(1);
  91.     }
  92.     TEST("add") {
  93.         add = Entervalue(add, CHECKSET);
  94.         return(1);
  95.     }
  96.     TEST("iter") {
  97.         iter = (int) Entervalue((double) iter, CHECKSET);
  98.         return(1);
  99.     }
  100.     TEST("gooditerate") {
  101.         goodIterate = (int) Entervalue((double) goodIterate, CHECKSET);
  102.         return(1);
  103.     }
  104.     TEST("oldgoodit") {
  105.         oldGoodIt = (int) Entervalue((double) oldGoodIt, CHECKSET);
  106.         return(1);
  107.     }
  108.     TEST("lyaptime") {    /* the following three lyap-s are for reading
  109.                    input from files and are not for direct use
  110.                    by the user */
  111.         lyaptime = Entervalue(lyaptime, CHECKSET);
  112.         return(1);
  113.     }
  114.     TEST("lyapstep") {
  115.         lyapstep = Entervalue(lyapstep, CHECKSET);
  116.         return(1);
  117.     }
  118.     TEST("lyapsum") {
  119.         for(i = 0; i < num_lyap; i++)
  120.                 /* for re-initializing vector lyapsum  */
  121.             lyapsum[i] = Entervalue(lyapsum[i], CHECKSET);
  122.         return(1);
  123.     }
  124.     TEST("lyapzero") {    /* this command is for reading maps from a file
  125.                    */
  126.         lyapzero = (int) Entervalue((double) lyapzero, CHECKSET);
  127.         return(1);
  128.     }
  129.     TEST("vec_dim") {    /* this command is for reading maps from a file
  130.                    */
  131.         vec_dim = (int) Entervalue((double) vec_dim, CHECKSET);
  132.         return(1);
  133.     }
  134.     TEST("zeroth") {    /* this command is for reading maps from a file
  135.                    */
  136.         zeroth = (int) Entervalue((double) zeroth, CHECKSET);
  137.         return(1);
  138.     }
  139.     TEST("initialization") {
  140.                 /* this command is for reading maps from a file
  141.                    */
  142.         initializerFlag = YES;
  143.         return(1);
  144.     }
  145.     TEST("endinitialization") {
  146.                 /* this command is for reading maps from a file
  147.                    */
  148.         initializerFlag = NO;
  149.         return(1);
  150.     }
  151.     TEST("dot") {
  152.         dot = (long) Entervalue((double) dot, CHECKSET);
  153.         return(1);
  154.     }
  155.     TEST("sf") {
  156.         screen_fraction = Entervalue(screen_fraction, CHECKSET);
  157.         return(1);
  158.     }
  159.     TEST("oxl") {
  160.         x_old_low = Entervalue(x_old_low, SETVALUE);/* code OXL */
  161.         return(1);
  162.     }
  163.     TEST("oxu") {
  164.         x_old_upp = Entervalue(x_old_upp, SETVALUE);/* code OXU */
  165.         return(1);
  166.     }
  167.     TEST("oyl") {
  168.         y_old_low = Entervalue(y_old_low, SETVALUE);
  169.         return(1);
  170.     }
  171.     TEST("oyu") {
  172.         y_old_upp = Entervalue(y_old_upp, SETVALUE);
  173.         return(1);
  174.     }
  175.     TEST("nxl") {
  176.         x_new_low = Entervalue(x_new_low, SETVALUE);/* code OXL */
  177.         return(1);
  178.     }
  179.     TEST("nxu") {
  180.         x_new_upp = Entervalue(x_new_upp, SETVALUE);/* code OXU */
  181.         return(1);
  182.     }
  183.     TEST("nyl") {
  184.         y_new_low = Entervalue(y_new_low, SETVALUE);
  185.         return(1);
  186.     }
  187.     TEST("nyu") {
  188.         y_new_upp = Entervalue(y_new_upp, SETVALUE);
  189.         return(1);
  190.     }
  191.     TEST("osd") {
  192.         OldDiameters = Entervalue(OldDiameters, SETVALUE);
  193.         return(1);
  194.     }
  195.     TEST("speed") {    /* this command is not called by the program
  196.                    and could be dispensed with; it puts the
  197.                    program in a mode where iterate_map is not
  198.                    called; however, it is in this state anyway
  199.                    when it starts a process and is only kicked
  200.                    out of it when IPP or L is called */
  201.         iteratee = IterIteratee;
  202.         return(1);
  203.     }
  204.     TEST("vertline") {    /* for resumption of basin calculations */
  205.         VertLine = (int) Entervalue((double) VertLine, CHECKSET);
  206.         return(1);
  207.     }
  208.     TEST2("filestop", "5555") {
  209.     /* if code == 5555 OR 6666 we switch to keyboard input */
  210.         temp = input;    /* store for later use */
  211.         input = StInput;
  212.         status = 1;
  213.     /* this means the disk file is NOT finished */
  214.         MainMenu();
  215.         PRINT setup);
  216.         PRINT
  217.             "\n Now enter command codes from the keyboard\n7777 continues disk read\n\n");
  218.         return(1);
  219.     }
  220.     TEST2("fileend", "6666") {
  221.         if(IsEndPIC == YES) {
  222.             fetchPic(NO);/* no means displace rather than add */
  223.             PRINT "Picture is loaded into pic[].\n");
  224.         }
  225.     /* if code == 6666 we switch to keyboard input */
  226.         NextArg();
  227.  
  228.         if(SCREEN) {
  229.             MainMenu();
  230.             PRINT setup);
  231.             PRINT
  232.                 "\n Now enter command codes from the keyboard\n\n");
  233.         }
  234.         return(1);
  235.     }
  236.     TEST2("filerestart", "7777") {
  237.     /* we switch back from keyboard input to disk input */
  238.         if(status == 0) {/* this means the disk file is finished */
  239.             PRINT
  240.                 "\nNothing is available to be read from disk");
  241.         }
  242.         else
  243.             input = temp;
  244.         return(1);
  245.     }
  246.     return(0);
  247. }
  248.  
  249.  
  250.  
  251.